<template>
  <Submenu :name="parent.name">
    <template slot="title">
      <Icon :type="parent.icon" />
      {{ parent.meta.title }}
    </template>
    <template v-for="(item, index) in this.parent.children">
      <re-submenu
        v-if="item.children"
        :key="`submenu_${index}`"
        :name="item.name"
        :parent="item"
      >
      </re-submenu>
      <MenuItem  v-else :key="`submenu_${index}`" :name="item.name">
        <Icon :type="item.icon" />
        {{ item.meta.title }}
      </MenuItem >
    </template>
  </Submenu>
</template>

<script>

export default {
  name: 'ReSubmenu',
  props: {
    parent: {
      type: Object,
      default: () => {}
    }
  }
}
</script>

<style>

</style>
